﻿<cfsilent>
	<cfscript>
		
		propAdvice = getProperty("serviceFactory").getBean("termPropertyAdvice");
		dictAdvice = getProperty("serviceFactory").getBean("senateDictionaryAdvice");
		
		event.setArg("pageTitle", "教学运行管理 - 考试安排 - 补考课程安排规则");
		
		sql = "SELECT 
					a.term_id, a.academic_year, 
					a.academic_term, a.term_prop 
				FROM t_term a  
				WHERE 
					SUBSTR(a.term_prop, 1, 1) = '1' 
					OR 
					SUBSTR(a.term_prop, 6, 1) = '1'
				ORDER BY a.term_id";
				
		queryObj = new Query(datasource = application.dnsSlave);
		rs_term = queryObj.execute(sql = sql).getResult();

		termId = event.getArg("TermID");
		
		currentTab = event.getArg("TabID", "labGenerator");

	</cfscript>
</cfsilent>

<div id="headArea">
	<div class="uiHeader uiHeaderWithImage ptm">
		<div class="clearfix uiHeaderTop">
			<div class="uiHeaderActions rfloat">
				<a class="uiButton" href="<cfoutput>#buildURL('examResitPlan')#</cfoutput>"><i class="mrs img btnList"></i><span class="uiButtonText">补考周次及课程分组</span></a>
			</div>
			<div>
				<h2 class="uiHeaderTitle">
					<i class="uiHeaderImage img icon16x16 setting"></i>补考名单生成
				</h2>
			</div>
		</div>
	</div>
</div>

<div class="UIElement">
	<ul class="senateFirstPage">
		<li>
			<div class="clearfix" id="create">
				
				<div class="UItab">
					<div class="tabLables">
						<span <cfif currentTab eq "labGenerator">class="active"</cfif> id="labGenerator" tabTarget="Generator">生成补考名单</span>
						<span <cfif currentTab eq "labClear">class="active"</cfif> id="labClear" tabTarget="Clear">清除补考数据</span>
					</div>
				</div>
				<script language="javascript" type="text/javascript">
					//<![CDATA[
					<!--
					$(document).ready(function() {
					
						/* init Tab */
						$("div.tabContent").hide();
						$("div#" + $("div.tabLables span.active").attr("tabTarget")).show();
						
						$("div.tabLables > span").click(function(){
							var $targetID = $(this).attr("tabTarget");
						
							$("div.tabLables span").removeClass("active");
							$(this).addClass("active");
							
							$("div.tabContent").not('[id="' + $targetID + '"]').hide();
							$("div.tabContent#" + $targetID).show();
						});
						
					});
					
					// -->
					//]]>
				</script>
				
				<div id="Clear" class="tabContent">
					
					<div class="systemNotice">
						<h3><span class="img icon16x16 info"></span>删除课程信息</h3>
						<p>注意: 您即将进行补考安排数据清除操作. 该操作会删除指定学期的补考成绩提交名单和补考分组安排. 执行该项操作后您需要重新生成补考名单, 所有已安排补考的时间、地点都将清零.</p>
					
						<form id="formRemove" class="formWrapper Transparent" method="post" action="<cfoutput>#buildURL('examResitClearDo')#</cfoutput>">
							<input type="hidden" name="resitTerm" value="<cfoutput>#termId#</cfoutput>" />
							<div class="lable"><input class="button2" type="submit" value="清除补考安排" /></div>
						</form>
					</div>
					
				</div>
				
				<div id="Generator" class="tabContent">
					
					<div class="systemNotice">
						<h3><span class="img icon16x16 info"></span>请仔细核对</h3>
						<p>请慎重选择要安排补考的条件, 系统将根据您选择的各项条件, 自动生成补考记录（用于提交补考成绩）.</p>
					</div>
					
					<form id="formRequired" onSubmit="javascript:return processVerfiyForm('formRequired');" class="formWrapper" method="post" action="<cfoutput>#buildURL('examResitCourseDo')#</cfoutput>">
						
						<div class="label">
							<b>课程授课学期</b>
                            <cfloop query="rs_term" >
								<cfset propAdvice.parseProperty(rs_term.term_prop) />
								<cfif propAdvice.getRunning()>
									<cfoutput>#rs_term.academic_year#</cfoutput> 学年 - <cfoutput>#dictAdvice.getTerm(rs_term.academic_term)#</cfoutput>
									<input name="markTerm" id="markTerm" type="hidden" value="<cfoutput>#rs_term.term_id#</cfoutput>" />
								</cfif>
							</cfloop>
						</div>
						
						<div class="label">
							<b>补考执行时间</b>
                            <cfloop query="rs_term" >
								<cfset propAdvice.parseProperty(rs_term.term_prop) />
								<cfif propAdvice.getForResitExam()>
									<cfoutput>#rs_term.academic_year#</cfoutput> 学年 - <cfoutput>#dictAdvice.getTerm(rs_term.academic_term)#</cfoutput>
									<input name="resitTerm" id="resitTerm" type="hidden" value="<cfoutput>#rs_term.term_id#</cfoutput>" />
								</cfif>
							</cfloop>
							
						</div>
						
						<hr/>
						
						<div class="lable">
							<input class="button1" type="submit" value="生成补考学生名单" />
						</div>
						
					</form>
					
				</div>
				
			</div>
		</li>
	</ul>
</div>